Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(concepts): improve writing style #3354

Merged

Conversation

bandantonio
Copy link
Contributor

@bandantonio bandantonio commented Oct 31, 2024

Description
This PR improves writing style of the documents located in the Concepts section.

Motivation: make writing more consistent and predictable, as well as easier to skim and understand.

Fixes #3374

Summary by CodeRabbit

  • Documentation
    • Enhanced clarity and consistency across multiple documents related to AsyncAPI concepts, including definitions and descriptions of channels, consumers, producers, and servers.
    • Improved readability of key terms and phrases, ensuring a better understanding of event-driven architecture and message protocols.
    • Updated diagrams and examples to provide clearer illustrations of concepts and their relationships.
    • Rephrased sections for better flow and understanding, particularly in definitions and explanations of roles within the architecture.

Copy link

coderabbitai bot commented Oct 31, 2024

Walkthrough

The changes across multiple markdown documents focus on enhancing clarity, consistency, and readability of the content related to AsyncAPI concepts. Key terms are emphasized, sentence structures are refined, and descriptions are streamlined to improve the overall flow of information. Specific adjustments include rephrasing definitions, clarifying roles and relationships within Event-Driven Architecture, and ensuring consistent terminology throughout the documents. Diagrams and their descriptions have also been updated for better comprehension.

Changes

File Path Change Summary
markdown/docs/concepts/application.md Rephrased for clarity; emphasized "application" in italics; modified definitions and examples for readability.
markdown/docs/concepts/asyncapi-document/index.md Textual modifications for clarity; adjusted phrases for grammatical consistency and improved readability.
markdown/docs/concepts/channel.md Enhanced clarity and consistency; rephrased definitions and descriptions; emphasized "channel" in italics.
markdown/docs/concepts/consumer.md Clarified descriptions of consumers; emphasized asynchronous behavior; updated diagram descriptions for consistency.
markdown/docs/concepts/index.md Simplified section header and introductory text for clarity.
markdown/docs/concepts/message.md Enhanced clarity and readability; streamlined definitions and descriptions; rephrased comparisons between messages and events.
markdown/docs/concepts/producer.md Improved clarity and consistency; refined definitions and examples; restructured explanations of the publish/subscribe model.
markdown/docs/concepts/protocol.md Enhanced clarity; restructured descriptions of protocols; updated terminology for formality.
markdown/docs/concepts/server.md Clarified server roles and interactions; emphasized messaging broker functions; improved descriptions of architecture.

Suggested labels

autoapproved, autoupdate

Suggested reviewers

  • quetzalliwrites
  • devilkiller-ag
  • sambhavgupta0705
  • BhaswatiRoy
  • J0SAL
  • TRohit20
  • VaishnaviNandakumar
  • asyncapi-bot-eve

🐰 In the garden where knowledge grows,
Clarity blooms, and understanding flows.
With words refined and meanings clear,
We hop along, spreading cheer!
Through channels and messages, we play,
In the world of AsyncAPI, we find our way! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Oct 31, 2024

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a13e3ce
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/672bdfb290b284000845af8e
😎 Deploy Preview https://deploy-preview-3354--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.14%. Comparing base (2fb1634) to head (a13e3ce).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3354   +/-   ##
=======================================
  Coverage   49.14%   49.14%           
=======================================
  Files          21       21           
  Lines         647      647           
=======================================
  Hits          318      318           
  Misses        329      329           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (11)
markdown/docs/concepts/channel.md (1)

10-10: Consider refining the sentence structure for better flow.

While the content is accurate and clear, the flow could be improved slightly.

Consider this revision:

-Channels are pivotal for establishing communication between producers and consumers. They enable producers to send messages, while consumers receive messages from specific channels. The primary function of a channel is to ensure that the intended messages reach the appropriate consumers.
+Channels play a pivotal role in establishing communication between producers and consumers. They enable producers to send messages and consumers to receive messages from specific channels. Their primary function is to ensure that messages reach their intended consumers.
markdown/docs/concepts/application.md (1)

8-10: Update spelling of "micro-service" to "microservice".

The definition changes improve clarity and readability. However, the term "micro-service" should be "microservice" as per common industry usage.

-An application can be a micro-service, IoT (Internet of things) device (for example, a sensor), mainframe process, and more.
+An application can be a microservice, IoT (Internet of things) device (for example, a sensor), mainframe process, and more.
🧰 Tools
🪛 LanguageTool

[misspelling] ~10-~10: This word is normally spelled as one.
Context: ...roup of them. An application can be a micro-service, IoT (Internet of things) device (for e...

(EN_COMPOUNDS_MICRO_SERVICE)

markdown/docs/concepts/message.md (2)

7-7: LGTM! Consider standardizing technical term formatting.

The definition and explanation are clear and technically accurate. The use of italics for message and metadata is good, but consider using consistent formatting for other technical terms like "JSON", "XML", "headers", and "properties" - either as inline code blocks or italics.

Also applies to: 9-9


Line range hint 24-35: LGTM! Consider adding brief descriptions for Query and Command.

The comparison between messages and events is well-structured and clear. The diagram effectively shows the hierarchy. However, while events are defined, the concepts of Query and Command are introduced in the diagram but not explained in the text.

Consider adding brief descriptions for Query and Command to maintain consistency with how Events are explained.

markdown/docs/concepts/consumer.md (1)

12-12: Consider clarifying what "completing the event data flow" means.

While the addition emphasizes the consumer's importance, it might be helpful to explicitly state what "completing the event data flow" entails, such as processing, transforming, or storing the event data.

Consider this revision:

-When you want your application to process events asynchronously, the consumer plays a crucial role in completing the event data flow through the event channel.
+When you want your application to process events asynchronously, the consumer plays a crucial role by receiving and processing events from the event channel, completing the event data flow.
markdown/docs/concepts/asyncapi-document/index.md (2)

Line range hint 10-39: Consider adding inline comments to enhance example readability.

While the YAML example is well-structured, adding strategic comments would help readers understand the purpose of each section better.

 asyncapi: 3.0.0
 info:
   title: Cool Example
   version: 0.1.0
+  # Define the channels where messages can be exchanged
 channels:
   userSignedUp:
     address: user/signedup
+    # Define the structure of messages that can be sent
     messages:
       userSignedUp:
         description: An event describing that a user just signed up.
         payload:
           type: object
           properties:
             fullName:
               type: string
             email:
               type: string
               format: email
             age:
               type: integer
               minimum: 18
+# Define the operations (actions) that can be performed
 operations: 
   userSignedUp:
     action: send
     channel: 
       $ref: '#/channels/userSignedUp'

40-40: Consider adding protocol-specific field examples.

The note about protocol-specific fields could be more helpful with concrete examples.

Consider expanding with examples like:

 Depending on the implemented protocol (such as MQTT, AMQP, Kafka, etc.), you may have additional fields in your AsyncAPI document. For example, for <a href= "https://github.com/asyncapi/bindings/tree/master/kafka">configuring Kafka bindings</a>.
+
+Examples of protocol-specific fields:
+- MQTT: QoS level, retain flag
+- Kafka: partition key, consumer group
+- AMQP: routing key, exchange type
markdown/docs/concepts/producer.md (1)

Line range hint 7-36: Consider adding a summary section

The document flows well, but could benefit from a brief summary section at the end that ties together the key points about producers. This would reinforce the main concepts and provide a quick reference for readers.

Example addition:

## Summary

A producer is a fundamental component in event-driven architecture that:
- Detects and publishes events as messages
- Acts as the first layer in the publish/subscribe model
- Can potentially serve as both publisher and subscriber
🧰 Tools
🪛 LanguageTool

[grammar] ~16-~16: Did you mean the noun “publishing”?
Context: ...or. ## Why do we need Producers? The publish/subscribe communication model is one of...

(PREPOSITION_VERB)

markdown/docs/concepts/server.md (3)

8-8: LGTM! Consider standardizing terminology.

The definition is technically accurate and provides a clear distinction from traditional API servers. However, the terms "messaging broker" and "message broker" are used interchangeably in this paragraph. Consider standardizing to one form throughout the documentation.

-A _server_ acts as a _messaging broker_ system
+A _server_ acts as a _message broker_ system

11-11: Consider clarifying the term "clients".

The explanation effectively describes the server's purpose. However, the term "clients" is italicized but not linked or explicitly defined. Consider either linking to a clients concept page (if it exists) or briefly clarifying what constitutes a client in this context.


38-38: Enhance diagram explanation and maintain consistent formatting.

While the explanation is technically accurate, consider these improvements:

  1. The term broker should be consistently formatted (either as code or italics)
  2. The explanation could more explicitly connect to the diagram elements
-The diagram above illustrates the Broker-centric Architecture. In this case, there are three AsyncAPI files for the `producer`, `consumer1`, and `consumer2`. In these AsyncAPI files, the [`Server Object`](https://www.asyncapi.com/docs/reference/specification/latest#serverObject) provides information about the `broker`, so that API users know where to connect to start receiving or sending messages.
+The diagram above illustrates the Broker-centric Architecture. In this case, there are three AsyncAPI files: one for the `producer` (left), and two for the consumers (`consumer1` and `consumer2`, right). In these AsyncAPI files, the [`Server Object`](https://www.asyncapi.com/docs/reference/specification/latest#serverObject) provides information about the `broker` (middle), enabling API users to establish connections for sending and receiving messages.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 983c80e and f0ccbfe.

📒 Files selected for processing (9)
  • markdown/docs/concepts/application.md (2 hunks)
  • markdown/docs/concepts/asyncapi-document/index.md (2 hunks)
  • markdown/docs/concepts/channel.md (2 hunks)
  • markdown/docs/concepts/consumer.md (2 hunks)
  • markdown/docs/concepts/index.md (1 hunks)
  • markdown/docs/concepts/message.md (3 hunks)
  • markdown/docs/concepts/producer.md (2 hunks)
  • markdown/docs/concepts/protocol.md (3 hunks)
  • markdown/docs/concepts/server.md (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • markdown/docs/concepts/protocol.md
🧰 Additional context used
🪛 LanguageTool
markdown/docs/concepts/application.md

[misspelling] ~10-~10: This word is normally spelled as one.
Context: ...roup of them. An application can be a micro-service, IoT (Internet of things) device (for e...

(EN_COMPOUNDS_MICRO_SERVICE)

markdown/docs/concepts/producer.md

[grammar] ~16-~16: Did you mean the noun “publishing”?
Context: ...or. ## Why do we need Producers? The publish/subscribe communication model is one of...

(PREPOSITION_VERB)

🔇 Additional comments (11)
markdown/docs/concepts/index.md (1)

8-8: Excellent improvements to the documentation structure!

The changes effectively improve readability by:

  1. Simplifying the header while moving the descriptive text to the introduction
  2. Using proper emphasis on key terms
  3. Adopting a more direct and professional tone

These modifications align perfectly with documentation best practices and the PR's objective of improving writing style.

Also applies to: 10-10

markdown/docs/concepts/channel.md (1)

7-7: Well-crafted definition with clear terminology!

The definition effectively explains the concept while maintaining consistency in formatting (italicized key terms) and providing valuable context about protocol-specific variations.

markdown/docs/concepts/application.md (2)

13-13: LGTM! Clear explanation of application roles.

The rephrasing improves clarity while maintaining technical accuracy. The added condition about protocol adherence provides valuable context for readers.


23-24: LGTM! Improved diagram description.

The new description better aligns with the mermaid diagram and provides a clearer explanation of the message flow between applications.

markdown/docs/concepts/consumer.md (3)

7-7: LGTM! Improved terminology precision.

The change from "listens for" to "subscribes to" better reflects the standard terminology in Event-Driven Architecture.


10-10: LGTM! Enhanced explanation of EDA principles.

The revised explanation better clarifies both the asynchronous nature and the decoupled characteristics of consumers in Event-Driven Architecture.


29-30: LGTM! Improved diagram description.

The revised description provides a clearer and more structured explanation of the event flow, making it easier for readers to understand the relationship between producers, brokers, and consumers.

markdown/docs/concepts/asyncapi-document/index.md (1)

6-6: Writing improvements enhance clarity and readability!

The revised text effectively:

  • Uses active voice for better engagement
  • Maintains technical accuracy while improving flow
  • Clearly explains the document's role in API description and message communication

Also applies to: 8-8

markdown/docs/concepts/producer.md (3)

7-13: Well-crafted improvements to the definition and examples!

The changes enhance readability through:

  • Appropriate emphasis on key terms using italics
  • More precise verb choices ("detects" instead of "senses")
  • Clearer, more consistent examples

16-16: Clear and accurate explanation of the publish/subscribe model!

The restructured sentence effectively emphasizes the importance of the publish/subscribe model in event-driven architecture.

🧰 Tools
🪛 LanguageTool

[grammar] ~16-~16: Did you mean the noun “publishing”?
Context: ...or. ## Why do we need Producers? The publish/subscribe communication model is one of...

(PREPOSITION_VERB)


Line range hint 24-36: Excellent improvements to diagram descriptions!

The updated descriptions:

  • Better align with the visual representations
  • Clearly explain the dual role capability (producer/consumer)
  • Provide a smoother reading experience
🧰 Tools
🪛 LanguageTool

[grammar] ~16-~16: Did you mean the noun “publishing”?
Context: ...or. ## Why do we need Producers? The publish/subscribe communication model is one of...

(PREPOSITION_VERB)

Comment on lines 20 to 21

The diagram above illustrates the communication process between a producer and a consumer. The producer sends a message through the channel, which then queues the message for delivery to the specific consumer.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update description to match the diagram's multiple consumers.

The current description mentions "specific consumer" in singular form, but the diagram shows multiple consumers receiving messages from the channel.

Consider this revision:

-The diagram above illustrates the communication process between a producer and a consumer. The producer sends a message through the channel, which then queues the message for delivery to the specific consumer.
+The diagram above illustrates the communication process between a producer and multiple consumers. The producer sends a message through the channel, which then queues the message for delivery to the connected consumers.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The diagram above illustrates the communication process between a producer and a consumer. The producer sends a message through the channel, which then queues the message for delivery to the specific consumer.
The diagram above illustrates the communication process between a producer and multiple consumers. The producer sends a message through the channel, which then queues the message for delivery to the connected consumers.

@@ -17,11 +18,10 @@ A{{sender application}} --> b --> C{{receiver application}}

```

In the diagram above, the sender application transmits a `message` to the receiver application.
The diagram above illustrates the sender application that transmits a message to the receiver application.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance the diagram description for better context.

While accurate, the description could be more informative by explaining the channel's role and connecting it to the previous definition.

Consider this enhancement:

- The diagram above illustrates the sender application that transmits a message to the receiver application.
+ The diagram above illustrates how a sender application transmits a message through a channel to a receiver application, demonstrating the basic flow of message-based communication.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The diagram above illustrates the sender application that transmits a message to the receiver application.
The diagram above illustrates how a sender application transmits a message through a channel to a receiver application, demonstrating the basic flow of message-based communication.

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Oct 31, 2024

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 44
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-3354--asyncapi-website.netlify.app/

@akshatnema
Copy link
Member

@bandantonio Are these changes made in consideration with @quetzalliwrites? I don't find any concerned issue linked with this PR.

@bandantonio
Copy link
Contributor Author

@akshatnema Sure, this was discussed with @quetzalliwrites some time ago. I pinged her again, so we could probably create an 'epic' issue for that so I can take care of all the related styling aspects across the docs.

@quetzalliwrites
Copy link
Member

Hola @akshatnema, thanks for looping me in! 😸 Yes, the good news it that Anthony had already talked to me about his suggestions offline. (I still need to review this PR and see if I agree tehehe)

Ah, @bandantonio, to Akshat's point, would you mind creating a new docs issue for your proposal to link to this PR? He makes a good point that a change proposed like this one needs a docs issue.

Copy link
Member

@quetzalliwrites quetzalliwrites left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, these changes are FANTASTIC, truly valuable work @bandantonio!!!

Thank you for making these improvements, and I agree the style guide would benefit from incorporating a guideline about italicizing the first time a NEW term is introduced.

That said, we should explicitely add this new rule to our current EPIC issue for the Style Guide: #1240.

I know, I know, we haven't merged the Style Guide yet?! Whattt? 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[📑 Docs]: Concepts: Improve writing style
4 participants